﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Globalization;
using System.Resources;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WLS
{
    public partial class Information : Form
    {
        data video;
        all_setting jazyk;
        public Information(data video_, ref all_setting _jazyk)
        {
            InitializeComponent();
            video = video_;
            jazyk = _jazyk;
            jazyk.JazykZmenen += new all_setting.ZmenaJazyku(jazyk_JazykZmenen);
            jazyk_JazykZmenen(jazyk.jazyk);
        }

        /// <summary>
        /// Změní jazyk
        /// </summary>
        /// <param name="jazyk"></param>
        void jazyk_JazykZmenen(string jazyk)
        {
            CultureInfo cultura = CultureInfo.CreateSpecificCulture(jazyk);
            ResourceManager manager = new ResourceManager("WLS.Res", typeof(Information).Assembly);
            label1.Text = manager.GetString("fileinfo", cultura);
            label2.Text = manager.GetString("name", cultura);
            label3.Text = manager.GetString("path", cultura);
            label4.Text = manager.GetString("size", cultura);
            label5.Text = manager.GetString("ext", cultura);
            label6.Text = manager.GetString("date", cultura);
            button3.Text = manager.GetString("back", cultura);
            this.Text = manager.GetString("information", cultura);
        }
        double size;
        string size_text;
        private void Information_Load(object sender, EventArgs e)
        {
            if (this.Tag != null) video = (data)this.Tag;
            //label7.Text =  video.nazev;//Name:
            //label8.Text =  video.path;//Path:
            //label5.Text = lab5 + video.pripona;//Ext:
            //if (video.velikost < 1048576) { size = video.velikost / 1024; size_text = string.Format("{0:N2} {1}", size, "KB"); } else { size = video.velikost / 1048576; size_text = string.Format("{0:N2} {1}", size, "MB"); }
            //label4.Text = lab4 + size_text;//Size:
            //label6.Text = lab6 + video.datum;//Date:
            label7.Text = video.silver.filesetname.ToString();
            label8.Text = video.nazev;
            label9.Text = video.path;
            if (video.velikost < 1048576) { size = video.velikost / 1024; size_text = string.Format("{0:N2} {1}", size, "KB"); } else { size = video.velikost / 1048576; size_text = string.Format("{0:N2} {1}", size, "MB"); }
            label10.Text = size_text;
            label11.Text = video.pripona;
            label12.Text = video.datum;
        }

        private void button3_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}